﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using Dao;

namespace Domain
{
    /// <summary>
    /// 建筑物等级
    /// </summary>
   public class BuildingLevel
   {
       public static Dictionary<short, BuildingLevel> BuildingLevels = new Dictionary<short, BuildingLevel>();
       public short Id;
       public int AgricultureMax;
       public int CommerceMax;
       public int TechnologyMax;
       public int EnduranceMax;
       public int CultureMax;
       public int PopulationMax;
       #region  初始化数据
       public static void Load()
       {
           if (BuildingLevels.Count > 0)
               return;
           DataTable tb = BuildingLevelDao.SelectAllBuilding("194_QXGJ.s3db");
           for (int i = 0; i < tb.Rows.Count; i++)
           {
               DataRow dr = tb.Rows[i];
               BuildingLevel s = new BuildingLevel();
               s.Id = Convert.ToInt16(dr["Id"]);
               s.AgricultureMax = Convert.ToInt32(dr["AgricultureMax"]);
               s.CommerceMax = Convert.ToInt32(dr["CommerceMax"]);
               s.TechnologyMax = Convert.ToInt32(dr["TechnologyMax"]);
               s.EnduranceMax = Convert.ToInt32(dr["EnduranceMax"]);
               s.CultureMax = Convert.ToInt32(dr["CultureMax"]);
               s.PopulationMax = Convert.ToInt32(dr["PopulationMax"]);
               BuildingLevels.Add(s.Id, s);
           }
       }
       public static void Init()
       {
          
       }

       #endregion
   }
}
